package org.javaboy.account.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.javaboy.account.model.Account;

@Mapper
public interface AccountMapper {
    @Select(value = "select id,user_id as userId,money from account_tbl where user_id=#{account}")
    Account selectById(Integer account);

    @Update(value = "update account_tbl set money=money-#{money} where user_id=#{account}")
    void deduce(@Param("account") Integer account, @Param("money") Double money);
}
